package constant

import (
	"sync"
	"time"

	gocache "github.com/patrickmn/go-cache"
)

const (
	// jwt负载信息
	JwtKeyUserInfo     = "user"
	JwtKeyUserId       = "userId"
	JwtKeyUserName     = "username"
	JwtKeyUserRoleIds  = "roleIds"
	JwtKeyUserRoleName = "roleName"
	JwtKeyUserDeptIds  = "deptIds"
	JwtKeyUserDeptName = "deptName"
	JwtKeyAgencyId     = "agency"
	JwtKeyAppId        = "appId"
	// 告警配置
	AlarmConfigKey = "alarm_config:"
	// 已告警条目缓存
	HasAlarmRowCache = "alarm_row"
	// 设备分组缓存
	DeviceDeptCache = "DEVDEPT"
	// 设备简讯缓存
	DeviceEasyCache = "dev_cache"
	// 事件列表缓存
	DevEventCache = "devEventCache"
	// from ssdevice - 已处理消息主题
	HandledMsgTopic = "/san/data/handle"
	// from ssdevice - 设备删除消息主题
	DeviceDeleteMsgTopic = "/san/event/device/delete"
	DeviceAddMsgTopic    = "/san/event/device/add"
	// to servers - 告警通知主题
	AlarmNotifyTopic = "/san/alarm/notify"
)

var (
	//配置文件
	ConfigFile = "config/settings.yml"
	// 本地缓存
	LocalCache = gocache.New(10*time.Second, 3*time.Second)
	// 有告警配置的sn
	HasAlarmConfigSn sync.Map
)
